package org.example.listener;

import org.example.annotation.ProducerKafkaMessage;
import org.springframework.aop.support.StaticMethodMatcherPointcutAdvisor;
import org.springframework.stereotype.Component;

import java.lang.reflect.Method;

/**
 *
 * @author youshang
 * @date 2021/02/20 19:19
 **/
public class B extends StaticMethodMatcherPointcutAdvisor {

    public B(A a){
        setAdvice(a);
    }

    @Override
    public boolean matches(Method method, Class<?> targetClass) {
        return method.isAnnotationPresent(ProducerKafkaMessage.class);
    }
}
